; https://discuss.ocaml.org/t/working-with-application-data-in-packages/9464/5?u=mro

(rule
 (target res.ml)
 (deps
  (source_tree ../res))
 (action
  (with-stdout-to
   %{target}
   (run ocaml-crunch --mode=plain ../res))))

(rule
 (target plain2handle.ml)
 (deps plain2handle.mll)
 (action
  (chdir
   %{workspace_root}
   (run %{bin:ocamllex} -q -o %{target} %{deps}))))

(rule
 (target plain2html.ml)
 (deps plain2html.mll)
 (action
  (chdir
   %{workspace_root}
   (run %{bin:ocamllex} -q -o %{target} %{deps}))))

(library
 (name seppo_lib)
 (libraries
  as2_vocab
  ; https://github.com/mirleft/ocaml-x509/blob/master/tests/dune
  ; camlp-streams ; https://discuss.ocaml.org/t/module-stream-removed-from-5-0-standard-library/10218/3?u=mro
  cohttp-lwt-unix
  csexp
  logs
  lwt.unix
  lambdasoup
  mcdb
  ; mirage-crypto-pk
  mirage-crypto-rng.unix
  optint
  ptime.clock.os
  re
  safepass
  str
  timedesc ; ~600k
  tls-lwt
  tyre
  unix
  uucp ; ~4m
  uuidm
  uunf.string
  xmlm)
 ; https://dev.realworldocaml.org/data-serialization.html#scrollNav-1-2
 ; (preprocess (pps ppx_sexp_conv))
 (preprocess
  (pps lwt_ppx))
 ; https://discuss.ocaml.org/t/lwt-ppx-binary-footprint/11818/2
 (flags
  (:standard -cclib "-z noexecstack" -safe-string)))
